import request from '@/utils/request'

// 查询公告列表
export function listNotice(params) {
  return request({
    url: '/admin/v1/sys/notice/list',
    method: 'get',
    params
  })
}

// 查询公告详细
export function getNotice(id) {
  return request({
    url: '/admin/v1/sys/notice/' + id,
    method: 'get'
  })
}

// 新增公告
export function addNotice(data) {
  return request({
    url: '/admin/v1/sys/notice/add',
    method: 'post',
    data
  })
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: '/admin/v1/sys/notice/update',
    method: 'put',
    data
  })
}

// 删除公告
export function delNotice(data) {
  return request({
    url: '/admin/v1/sys/notice/delete',
    method: 'delete',
    data
  })
}

// 导出公告
export function exportNotice(query) {
  return request({
    url: '/admin/v1/sys/notice/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
